package com.rm.zeyou.controller;

import cn.dev33.satoken.annotation.SaCheckLogin;
import com.rm.zeyou.entity.Technician;
import com.rm.zeyou.response.ApiRestResponse;
import com.rm.zeyou.service.BrokerApplyService;
import com.rm.zeyou.util.login.TechnicianLoginUtil;
import com.rm.zeyou.vo.request.ApplyBrokerVo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

/**
 * <p>
 * 前端控制器
 * </p>
 *
 * @author YanYang
 * @since 2025-03-25 10:58:33
 */
@Api(tags = "经纪人申请相关")
@RestController
@RequestMapping("/api/brokerApply")
public class BrokerApplyController {
    @Resource
    private BrokerApplyService brokerApplyService;
    @Resource
    private TechnicianLoginUtil technicianLoginUtil;



    @ApiOperation(value = "申请经纪人")
    @PostMapping("applyBroker")
    @SaCheckLogin(type = "technician")
    public ApiRestResponse<Integer> applyBroker(@RequestBody ApplyBrokerVo applyVo) {
        Technician technician = technicianLoginUtil.getTechnician();
        return brokerApplyService.applyBroker(technician,applyVo);
    }


}
